<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>失物详情</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css" rel="stylesheet">
    <style>
        body {
            overflow-x: hidden;
        }
        #sidebar {
            min-height: 100vh;
            box-shadow: 2px 0 5px rgba(0,0,0,0.1);
            position: fixed;
            left: 0;
            top: 0;
            z-index: 1000;
        }
        .main-content {
            margin-left: 0;
            transition: margin-left 0.3s;
            position: relative;
            z-index: 1;
        }
        @media (min-width: 768px) {
            .main-content {
                margin-left: 25%;
            }
        }
        @media (min-width: 992px) {
            .main-content {
                margin-left: 16.666667%;
            }
        }
    </style>
</head>
<body>
    <div class="container-fluid">
        <div class="row">
            <!-- 侧边导航栏 -->
            <div th:replace="fragments/sidebar :: sidebar"></div>

            <!-- 主内容区域 -->
            <main class="col-md-9 ms-sm-auto col-lg-10 px-md-4 main-content">
                <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
                    <h1 class="h2">失物详情</h1>
                    <div class="btn-toolbar mb-2 mb-md-0">
                        <a th:href="@{/lost-item/list}" class="btn btn-sm btn-outline-secondary">
                            <i class="bi bi-arrow-left"></i> 返回列表
                        </a>
                    </div>
                </div>

                <div class="card">
                    <div class="card-body">
                        <div class="row">
                            <div class="col-md-8">
                                <h4 th:text="${lostItem.title}" class="mb-3"></h4>
                                
                                <div class="row mb-3">
                                    <div class="col-sm-4">
                                        <strong>分类：</strong>
                                        <span th:text="${lostItem.category}"></span>
                                    </div>
                                    <div class="col-sm-4">
                                        <strong>丢失地点：</strong>
                                        <span th:text="${lostItem.location}"></span>
                                    </div>
                                    <div class="col-sm-4">
                                        <strong>状态：</strong>
                                        <span th:if="${lostItem.status == 0}" class="badge bg-warning">未认领</span>
                                        <span th:if="${lostItem.status == 1}" class="badge bg-success">已认领</span>
                                    </div>
                                </div>
                                
                                <div class="mb-3">
                                    <strong>详细描述：</strong>
                                    <p th:text="${lostItem.description}" class="mt-2"></p>
                                </div>
                                
                                <div class="row mb-3">
                                    <div class="col-sm-6">
                                        <strong>提交时间：</strong>
                                        <span th:text="${#temporals.format(lostItem.submitTime, 'yyyy-MM-dd HH:mm')}"></span>
                                    </div>
                                </div>
                                

                            </div>
                            
                            <div class="col-md-4" th:if="${lostItem.imageUrl != null and lostItem.imageUrl != ''}">
                                <div class="text-center">
                                    <img th:src="${lostItem.imageUrl}" alt="物品图片" class="img-fluid rounded" style="max-height: 300px;">
                                </div>
                            </div>
                        </div>
                        
                        <div class="mt-4">
                            <a th:href="@{/lost-item/edit/{id}(id=${lostItem.id})}" class="btn btn-primary">编辑</a>
                            <a th:href="@{/lost-item/list}" class="btn btn-secondary">返回列表</a>
                        </div>
                    </div>
                </div>
            </main>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>